package com.itstyle.mytest.threadpoolexecutor.policy;

import com.itstyle.mytest.threadpoolexecutor.ThreadPoolExecutor;
import com.itstyle.mytest.threadpoolexecutor.exception.PolicyException;

/**
 * @author xianguang
 * @date 2020-01-06 14:05
 */
public class DefaultPolicyHandler implements PolicyHandler {
    @Override
    public void rejected(Runnable task, ThreadPoolExecutor executor) {
        System.out.println("任务已经满了");
        throw new PolicyException("任务已经满了");
    }
}
